package com.demomaster.quickcompat.widget.dialog;

import android.content.Context;

import com.demomaster.quickcompat.R;
import com.demomaster.quickcompat.util.DisplayUtil;


/**
 * Created by Squirrel桓 on 2019/1/6.
 */
public class QuickInputDialog extends QuickDialog {

    public QuickInputDialog(Context context, Builder builder) {
        super(context,builder);
        init();
    }

    private void init() {

    }


    public static class Builder extends QuickDialog.Builder<Builder> {
        public int actionButtonPadding;
        private float[] backgroundRadius = new float[8];

        public Builder(Context context) {
            super(context);
            animationStyleID = R.style.qd_dialog_animation_center_scale;
            this.layoutResID = R.layout.quick_dialog_layout_input;
            this.actionButtonPadding = DisplayUtil.dip2px(context, 8);
        }

        public Builder setContext(Context context) {
            this.context = context;
            return this;
        }

        public Builder setActionButtonPadding(int actionButtonPadding) {
            this.actionButtonPadding = actionButtonPadding;
            return this;
        }

        public Builder setBackgroundRadius(float backgroundRadiu) {
            for (int i = 0; i < backgroundRadius.length; i++) {
                this.backgroundRadius[i] = backgroundRadiu;
            }
            return this;
        }

        public Builder setBackgroundRadius(float[] backgroundRadius) {
            this.backgroundRadius = backgroundRadius;
            return this;
        }

        public Builder setAnimationStyleID(int animationStyleID) {
            this.animationStyleID = animationStyleID;
            return this;
        }

        public Builder setWidth(int width) {
            this.width = width;
            return this;
        }

//        public Builder bindInputView(@IdRes int viewResId, String text) {
//            return (Builder) bindView(viewResId, text, null);
//        }

        public QuickInputDialog create() {
            return new QuickInputDialog(context, this);
        }
    }
}
